﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WebExam.DataEntities;

namespace WebExam.DataProvider
{
    public interface IBJRepository
    {
        /// <summary>
        /// 根据职工id获取班级信息
        /// </summary>
        /// <param name="zgId">职工Id</param>
        IQueryable<BJ> GetAllByZgId(int zgId);

        /// <summary>
        /// 根据职工id获取班级信息
        /// </summary>
        /// <param name="zgId">职工Id</param>
        /// <param name="start">开始位置</param>
        /// <param name="takeSize">获取条数</param>
        IQueryable<BJ> GetAllByZgId(int zgId, int start, int takeSize);

        /// <summary>
        /// 根据专业Id获取班级信息
        /// </summary>
        /// <param name="zyId">专业Id</param>
        IQueryable<BJ> GetAllByZyId(int zyId);

        /// <summary>
        /// 根据专业Id获取班级信息
        /// </summary>
        /// <param name="zyId">专业Id</param>
        /// <param name="start">开始位置</param>
        /// <param name="takeSize">获取条数</param>
        IQueryable<BJ> GetAllByZyId(int zyId, int start, int takeSize);

        /// <summary>
        /// 根据班级Id获取班级信息
        /// </summary>
        /// <param name="bjId">班级Id</param>
        BJ Get(int bjId);

        /// <summary>
        /// 添加班级信息
        /// </summary>
        /// <param name="bj">班级对象</param>
        BJ Add(BJ bj);

        /// <summary>
        /// 更新班级信息
        /// </summary>
        /// <param name="bjId">班级Id</param>
        /// <param name="update">包含更新操作的方法</param>
        BJ Update(int bjId, Action<BJ> update);

        /// <summary>
        /// 删除班级信息
        /// </summary>
        /// <param name="bjId">班级Id</param>
        bool Delete(int bjId);

        /// <summary>
        /// 根据职工Id统计记录条数
        /// </summary>
        /// <param name="zgId">职工Id</param>
        int CountByZgId(int zgId);

        /// <summary>
        /// 根据专业Id统计记录条数
        /// </summary>
        /// <param name="zyId">专业Id</param>
        int CountByZyId(int zyId);
    }
}